﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Net;

namespace ApiPrototype
{
    public class ApiException : Exception
    {
        public HttpStatusCode Code { get; set; }

        public ApiException()
            : base("Internal Server Error")
        {
            Code = HttpStatusCode.InternalServerError;
        }

        public ApiException(string message, HttpStatusCode statusCode = HttpStatusCode.InternalServerError)
            : base(message)
        {
            Code = statusCode;
        }

        public ApiException(string message, Exception innerException, HttpStatusCode statusCode = HttpStatusCode.InternalServerError)
            : base(message, innerException)
        {
            Code = statusCode;
        }

        public ApiException(Exception innerException)
            : base("Internal Server Error", innerException)
        {
            Code = HttpStatusCode.InternalServerError;
        }

        
    }
}